<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="bootstrap/css/bootstrap.css" rel="stylesheet">
    <script type="text/javascript" src="js/axios.min.js"></script>
    <script type="text/javascript" src="js/vue.js"></script>
    <script type="text/javascript" src="js/const.js"></script>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>

</head>
<body>
<div id="app" class="container">
    <h1>The Activitys Page</h1>

    <!-- Button trigger modal -->
    <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
        创建活动
    </button>

    <!-- Modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">Modal title</h4>
                </div>
                <div class="modal-body">
                    ...
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary">Save changes</button>
                </div>
            </div>
        </div>
    </div>
    <table class="table">
        <thead>
        <thead>
        <tr>
            <th>id</th>
            <th>title</th>
            <th>category</th>
            <th>startTime</th>
            <th>endTime</th>
            <th>remark</th>
            <th>state</th>
            <th>creatTime</th>
            <th>createUser</th>
        </tr>
        </thead>
        <tbody>
        <tr v-for="activity in activityList">
            <td>{{activity.id}}</td>
            <td>{{activity.title}}</td>
            <td>{{activity.category}}</td>
            <td>{{activity.startTime}}</td>
            <td>{{activity.endTime}}</td>
            <td>{{activity.remark}}</td>
            <td>{{activity.state}}</td>
            <td>{{activity.creatTime}}</td>
            <td>{{activity.createUser}}</td>
        </tr>
        </tbody>
    </table>

</div>
</body>
<script>

    var config={
        el:"#app",
        data:{
            activityList:[
            ],
        },
        methods:{
            findActivitys:function(){
                // url="http://localhost/findActivitys";
                let url=serverHost+"findActivitys";
                axios.get(url).then(
                    function(res){
                        this.vue.activityList = res.data;
                    }
                );
            }
        },
        mounted:function(){
            this.findActivitys();
        }
    };

    var vue = new Vue(config);
</script>
</html>